home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 6979 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Subject: Re: Collision Detects !!!!
  2. References: <199604051601.QAA18722@mailhost.unibol.com>
  3. X-Newsreader: TIN [version 1.2 PL2]
  4. Path: imada.ou.dk!breese
  5. From: breese@imada.ou.dk (Bjorn Reese)
  6. Message-ID: <1996Apr7.111956.23541@imada.ou.dk>
  7. Sender: news@imada.ou.dk
  8. Nntp-Posting-Host: wagner.imada.ou.dk
  9. Organization: Dept. of Math. & Computer Science, Odense University, Denmark
  10. Date: Sun, 7 Apr 1996 11:19:56 GMT
  11. Newsgroups: comp.sys.amiga.programmer
  12.  
  13. John Girvin (jgirvin@bfs.unibol.com) wrote:
  14.  
  15. > if ( (px2 - bullet[i]->x) < (bullet[i]->width + player->width) &&
  16. >       ^^^   ^^^^^^^^^^^^
  17. >        swapped!
  18.  
  19. Ok, makes sense now. I simply love it!
  20.  
  21. > :>as player->width is present on both sides of the inequality it can be
  22. > :>omitted.
  23. > Well spotted! I never noticed that myself :) I dont think it would make
  24.  
  25. On a second look it would be fatal to remove player->width from the
  26. inequality. I was initially puzzled by it's appearence, but now I've
  27. realized that it's the principal cause why the unsigned comparison works.
  28. The player->width on the right hand side of the inequality becomes
  29. insignificant when the bullet is too far right, whereas the one on the
  30. left hand side doesn't.
  31.  
  32. > Not necessarily, I think. I read one document that claimed to solve
  33. > this problem by shifting the sector dividing lines by half a sector
  34. > width&height and repeating the collision check 4 times in all for
  35. > :x,y x+0.5,y x,y+0.5 x+0.5,y+0.5. It was something like that anyway,
  36.  
  37. While I conceptually get the idea, I wonder how they can make such
  38. a division on a linked list (or an array for that matter.) They must
  39. be using a different implementation of subsectoring than the ones I
  40. know of. I would definitely like to see that document.
  41.  
  42. > but dont quote me - youve seen what my memory is like already ;)
  43.  
  44. Yeah, seems to be very compatible with mine :)
  45.  
  46. --
  47. Bjorn Reese                      Email: breese@imada.ou.dk
  48. Odense University, Denmark       URL:   http://www.imada.ou.dk/~breese
  49.  
  50. "It's getting late in the game to show any pride or shame" - Marillion
  51.